home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 7 / Apprentice-Release7.iso / Source Code / C / Applications / Tcl-Tk 8.0 / Pre-installed version / tk8.0 / tests / canvPsBmap.tcl < prev    next >
Encoding:
Text File  |  1997-08-15  |  2.7 KB  |  72 lines  |  [TEXT/ALFA]

  1. # This file creates a screen to exercise Postscript generation
  2. # for bitmaps in canvases.  It is part of the Tk visual test suite,
  3. # which is invoked via the "visual" script.
  4. #
  5. # SCCS: @(#) canvPsBmap.tcl 1.5 96/07/25 15:54:14
  6.  
  7. catch {destroy .t}
  8. toplevel .t
  9. wm title .t "Postscript Tests for Canvases"
  10. wm iconname .t "Postscript"
  11. wm geom .t +0+0
  12. wm minsize .t 1 1
  13.  
  14. set c .t.c
  15.  
  16. message .t.m -text {This screen exercises the Postscript-generation abilities of Tk canvas widgets for bitmaps.  Click on "Print" to print the canvas to your default printer.  You can click on items in the canvas to delete them.} -width 6i
  17. pack .t.m -side top -fill both
  18.  
  19. frame .t.bot
  20. pack .t.bot -side bottom -fill both
  21. button .t.bot.quit -text Quit -command {destroy .t}
  22. button .t.bot.print -text Print -command "lpr $c"
  23. pack .t.bot.print .t.bot.quit -side left -pady 1m -expand 1
  24.  
  25. canvas $c -width 6i -height 6i -bd 2 -relief sunken
  26. pack $c -expand yes -fill both -padx 2m -pady 2m
  27.  
  28. $c create bitmap 0.5i 0.5i \
  29.     -bitmap @[file join $tk_library demos/images/flagdown.bmp] \
  30.     -background {} -foreground black -anchor nw
  31. $c create rect 0.47i 0.47i 0.53i 0.53i -fill {} -outline black
  32.  
  33. $c create bitmap 3.0i 0.5i \
  34.     -bitmap @[file join $tk_library demos/images/flagdown.bmp] \
  35.     -background {} -foreground black -anchor n
  36. $c create rect 2.97i 0.47i 3.03i 0.53i -fill {} -outline black
  37.  
  38. $c create bitmap 5.5i 0.5i \
  39.     -bitmap @[file join $tk_library demos/images/flagdown.bmp] \
  40.     -background black -foreground white -anchor ne
  41. $c create rect 5.47i 0.47i 5.53i 0.53i -fill {} -outline black
  42.  
  43. $c create bitmap 0.5i 3.0i \
  44.     -bitmap @[file join $tk_library demos/images/face.bmp] \
  45.     -background {} -foreground black -anchor w
  46. $c create rect 0.47i 2.97i 0.53i 3.03i -fill {} -outline black
  47.  
  48. $c create bitmap 3.0i 3.0i \
  49.     -bitmap @[file join $tk_library demos/images/face.bmp] \
  50.     -background {} -foreground black -anchor center
  51. $c create rect 2.97i 2.97i 3.03i 3.03i -fill {} -outline black
  52.  
  53. $c create bitmap 5.5i 3.0i \
  54.     -bitmap @[file join $tk_library demos/images/face.bmp] \
  55.     -background blue -foreground black -anchor e
  56. $c create rect 5.47i 2.97i 5.53i 3.03i -fill {} -outline black
  57.  
  58. $c create bitmap 0.5i 5.5i \
  59.     -bitmap @[file join $tk_library demos/images/flagup.bmp] \
  60.     -background black -foreground white -anchor sw
  61. $c create rect 0.47i 5.47i 0.53i 5.53i -fill {} -outline black
  62.  
  63. $c create bitmap 3.0i 5.5i \
  64.     -bitmap @[file join $tk_library demos/images/flagup.bmp] \
  65.     -background green -foreground white -anchor s
  66. $c create rect 2.97i 5.47i 3.03i 5.53i -fill {} -outline black
  67.  
  68. $c create bitmap 5.5i 5.5i \
  69.     -bitmap @[file join $tk_library demos/images/flagup.bmp] \
  70.     -background {} -foreground black -anchor se
  71. $c create rect 5.47i 5.47i 5.53i 5.53i -fill {} -outline black
  72.